Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move boot_aplx.s stack to bottom half of DTCM #139

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

lplana
Copy link
Member

@lplana lplana commented Sep 14, 2020

This PR addresses issue #137. It completes the move of all scamp components previously located in the TOP half of DTCM to the bottom half.

This allows the boot image to be 32 KiB long.

The safety of the stack move is an issue given that boot_aplx.s is used to boot scamp and also to scatter load applications. It is safe to locate the boot_aplx.s stack at the top of the bottom half of DTCM to boot scamp but it appears unsafe to do it when loading applications. An application can occupy any part of DTCM, potentially overwriting the boot_aplx.s stack, compromising the aplx scatter process.

To resolve the possible stack corruption issue during application scatter load, in this PR boot_aplx.bin is built twice, with different stack settings: top of bottom half of DTCM for scamp (scamp_boot_aplx.bin) and top of DTCM for applications (boot_aplx.bin).

@lplana lplana requested a review from rowleya September 14, 2020 12:40
@lplana lplana linked an issue Sep 14, 2020 that may be closed by this pull request
@lplana lplana marked this pull request as draft September 16, 2020 11:24
@lplana lplana self-assigned this Sep 20, 2020
@lplana lplana marked this pull request as ready for review September 21, 2020 08:20
Luis A. Plana added 2 commits September 23, 2020 11:24
@lplana lplana marked this pull request as draft October 12, 2020 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCAMP: boot_aplx.s stack may overwrite boot image
1 participant